package cz.semjob.learning.instances;

import java.util.List;

import cz.semjob.document.annotation.metadata.Relation;
import cz.semjob.document.processing.DocumentInstance;
import cz.semjob.learning.data.attribute.AInstanceAttribute;

public class LabeledRelationInstance extends UnlabeledRelationInstance {

	private Relation label;

	public LabeledRelationInstance(List<AInstanceAttribute> attributesList,
			DocumentInstance documentInstance) {
		super(attributesList, documentInstance);
	}

	public Relation getLabel() {
		return label;
	}

	public void setLabel(Relation label) {
		this.label = label;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((label == null) ? 0 : label.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		LabeledRelationInstance other = (LabeledRelationInstance) obj;
		if (label == null) {
			if (other.label != null)
				return false;
		} else if (!label.equals(other.label))
			return false;
		return true;
	}

}
